package modele;

public class PromissoryLetter extends Letter<Integer> {

	public PromissoryLetter(Inhabitant s, Inhabitant r, int a) {
		super(s, r);
		content = a;
	}

	@Override
	public int getCost() {
		return (int) (content * 1.1);
	}

	@Override
	public void doAction() {
		getReceiver().credit(content);
		System.out.println("~ Letter contained money ($" + content + "), "
				+ getReceiver() + " have now $" + getReceiver().getBalance()
				+ ".");
		getReceiver().sendLetter(new ThankLetter(this));
	}

	@Override
	public String getType() {
		return "promissory letter";
	}

}
